package web

import (
	"fmt"
	"net/http"
	"strings"
)

func SayHello(w http.ResponseWriter, r *http.Request) {
	_ = r.ParseForm()   //3	解析参数，默认是不会解析的
	fmt.Println(r.Form) //4 输出到服务器端的打印信息
	fmt.Println("Path: ", r.URL.Path)
	fmt.Println("Host: ", r.Host)
	for k, v := range r.Form {
		fmt.Println("key: ", k)
		fmt.Println("val", strings.Join(v, ""))
	}
	fmt.Fprintf(w, "Hello Web, %s!", r.Form.Get("name")) //5 写入到W的是输出到客户端的内容
}
